/**
 * vue引入
 */
import {createApp} from "vue"
import App from "./App.vue"
import router from "@/frame/router"
import {createPinia} from "pinia"

/**
 * element
 */
import ElementPlus from "element-plus"
import zhCn from "element-plus/es/locale/lang/zh-cn.mjs"
import "element-plus/dist/index.css"
import * as Icons from '@element-plus/icons-vue'

/**
 * 框架
 */
import "@/framework/style/reset.scss"
import "@/framework/style/element-style.scss"
import {CustomComponents} from "@/framework/index.ts"

/**
 * 初始化处理
 */
import {init} from "@/frame/config/index.ts"

/**
 * 初始化
 */
init()
const pinia = createPinia()
const app = createApp(App)
app.use(pinia)
app.use(ElementPlus, {locale: zhCn})
app.use(router)

/**
 * 注册
 */
//图标
for (const [name, icon] of Object.entries(Icons)) {
    app.component(name, icon)
}
//自定义组件
Object.entries(CustomComponents).forEach(([name, component]) => {
    app.component(name, component)
})

/**
 * 挂载
 */
app.mount("#app")